from fisher import db
from flask import Flask


def register_web_blueprint(app):
    from fisher import web
    app.register_blueprint(web)


def create_app(config=None):
    app = Flask(__name__)
    app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://root:1230@localhost:3306/fisher"
    app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True

    db.init_app(app)
    db.create_all(app=app)

    register_web_blueprint(app)
    return app
